//
//  RHRightAxisFormatter.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/10/20.
//

#import "RHRightAxisFormatter.h"
@interface RHRightAxisFormatter()
@property (nonatomic, strong) NSMutableArray *unitArr;

@end
@implementation RHRightAxisFormatter
- (RHRightAxisFormatter *)initWithUnitArr:(NSMutableArray *)unitArr
{
    if(self = [super init]){
        _unitArr = unitArr;
    }
    return self;
}
- (NSString *)stringForValue:(double)value axis:(ChartAxisBase *)axis
{
    if(self.unitArr.count<2) return @"  ";
    NSNumber *number =  [NSNumber numberWithDouble:value];
    NSString *strValue = [number twoDecimalPlacesWithoutRounding];
    return  [NSDecimalNumber decimalStringWithDoubleString:strValue nullStr:@"--"];
}
@end
